#include <iostream>
#define N 100

using namespace std;

int remove_zero(int array[],int elements){
int i, j;
for(i=0;i<elements;i++)
    if(array[i]==0){
        for (j=i;j<elements-1;j++)
            array[j]=array[j+1];
        --elements;
        if(array[i]==0)
            --i;}
return elements;
}

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

void printintVector(int array[], int elements){
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int array[N];
int elements;
int new_elements;

cout<<"Type the number of elements you want in the array: ";
cin>>elements;

readintVector(array, elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;

new_elements=remove_zero(array, elements);
cout<<"The array without 0's is: ";
printintVector(array, new_elements);

return 0;
}
